cmake_minimum_required(VERSION 3.10)

project(nvcc_demo)

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)

if(DEFINED ARCH)
    if(${ARCH} STREQUAL "x64")
        set(ncnn_DIR "/home/mod/code/DL/Tencent/ncnn/build/install/lib/cmake/ncnn")
    elseif(${ARCH} STREQUAL "arm64")
        set(ncnn_DIR "${CMAKE_SOURCE_DIR}/lib/ncnn/lib/cmake/ncnn")
        set(OpenCV_DIR "${CMAKE_SOURCE_DIR}/lib/opencv-mobile-4.5.1-armlinux/aarch64-linux-gnu/lib/cmake/opencv4")
    elseif(${ARCH} STREQUAL "android")
        message(STATUS "build for android")
        set(ncnn_DIR "/home/mod/code/DL/Tencent/ncnn/build-android-aarch64/install/lib/cmake/ncnn")
        set(OpenCV_DIR "/home/mod/code/opencv/mobile/release/opencv-mobile-4.5.1-android/sdk/native/jni")
    else()
        message(FATAL_ERROR "no this ARCH")
    endif()
else()
    message(FATAL_ERROR "please set ARCH !!!")
endif()


find_package(OpenCV REQUIRED)
find_package(ncnn REQUIRED)

add_subdirectory(src)
add_subdirectory(benchmark)
